package polymorphic.homework1;

public class TestAimal {
    public static void main(String[] args) {
        Animal a=new Dog("旺财狗");
        a.eat();
        a=new Cat("兰兰猫");
        a.eat();
        if (a instanceof Cat){
            Cat cat=(Cat)a;
            cat.catchMouse();
        }
        a=new Eagle("猴面鹰");
        a.eat();
    }
}
